package com.lekang.system.service.impl;

import com.lekang.system.domain.NursingPlanLevelBinding;
import com.lekang.system.mapper.NursingPlanLevelBindingMapper;
import com.lekang.system.service.INursingPlanLevelBindingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 护理计划与护理等级中间表Service业务层处理
 *
 *
 * @date 2025-10-15
 */
@Service
public class NursingPlanLevelBindingServiceImpl implements INursingPlanLevelBindingService {

    @Autowired
    private NursingPlanLevelBindingMapper bindingMapper;

    @Override
    public List<NursingPlanLevelBinding> selectBindingList(NursingPlanLevelBinding binding) {
        return bindingMapper.selectBindingList(binding);
    }

    @Override
    public int insertBinding(NursingPlanLevelBinding binding) {
        return bindingMapper.insertBinding(binding);
    }

    @Override
    public int batchInsertBinding(List<NursingPlanLevelBinding> bindings) {
        int count = 0;
        for (NursingPlanLevelBinding binding : bindings) {
            count += bindingMapper.insertBinding(binding);
        }
        return count;
    }

    @Override
    public int deleteBindingByPlanId(Long planId) {
        return bindingMapper.deleteBindingByPlanId(planId);
    }
}